class MyError(Exception):

    def __init__(self, value):
        self.value = value

    def __str__(self):
        return repr(self.value)


try:
    raise MyError(1222)
except MyError as e:
    print("occurred my exception:",e.value)
